package com.sdp.right.db.sys_flow_template.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sdp.right.db.sys_flow_template.mapper.SysFlowTemplateMapper;
import com.sdp.right.db.sys_flow_template.service.ISysFlowTemplateService;
import com.sdp.right.entity.SysFlowTemplate;
import com.sdp.right.service.RemoveSystemService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-07-09
 */
@Service
@DS(value="right")
public class SysFlowTemplateServiceImpl extends ServiceImpl<SysFlowTemplateMapper, SysFlowTemplate> implements ISysFlowTemplateService,RemoveSystemService {

	@Override
	public void removeBySystemNo(String systemNo) {
		LambdaQueryWrapper<SysFlowTemplate> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(SysFlowTemplate::getSystemNo, systemNo);
		remove(queryWrapper);
	}

	@Override
	public void removeFlowTemplateByTemplateNo(String templateNo) {
		LambdaQueryWrapper<SysFlowTemplate> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(SysFlowTemplate::getTemplateNo, templateNo);
		remove(queryWrapper);
		
	}

	@Override
	public SysFlowTemplate queryFlowTemplate(String templateNo) {
		LambdaQueryWrapper<SysFlowTemplate> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(SysFlowTemplate::getTemplateNo, templateNo);
		return getOne(queryWrapper,false);
	}

}
